package com.fau.fm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 地址地区表实体类
 * @author kangyj
 * @datetime 2014年11月8日,下午5:44:56
 */
@Entity
@Table(name = "medical_district")
public class MedicalDistrict implements Serializable, JSONAware {

	private static final long serialVersionUID = 4208516028272850751L;

	private String id;
	private String dName;		// 地区名称
	private String cId;			// 城市id
	
	@Id
	@GenericGenerator(name = "generator", strategy = "assigned")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 20)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "d_name", length = 50)
	public String getdName() {
		return dName;
	}

	public void setdName(String dName) {
		this.dName = dName;
	}

	@Column(name = "c_id", length = 20)
	public String getcId() {
		return cId;
	}

	public void setcId(String cId) {
		this.cId = cId;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("id", id);
		obj.put("dName", this.dName);
		obj.put("cId", this.cId);
		return obj.toString();
	}

}
